import 'package:flutter/material.dart';

class IconTextButton extends StatelessWidget {
  final Widget iconWidget;
  final Widget textWidget;

  final VoidCallback? onPress;
  final double space;

  const IconTextButton({
    Key? key,
    required this.iconWidget,
    required this.textWidget,
    this.space = 8.0,
    this.onPress,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onPress,
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          iconWidget,
          SizedBox(width: space),
          textWidget,
        ],
      ),
    );
  }
}
